home *** CD-ROM | disk | FTP | other *** search
- Path: dawn.mmm.com!news
- From: kjhopps@mmm.com (Kevin J Hopps)
- Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.tools.mfc
- Subject: Re: Best way to resume from an exception
- Followup-To: comp.lang.c++,comp.os.ms-windows.programmer.tools.mfc
- Date: 12 Mar 1996 15:01:47 GMT
- Organization: 3M - St. Paul, MN 55144-1000 US
- Message-ID: <4i43kr$8nu@dawn.mmm.com>
- References: <4i1qr9$g15@nntp1.best.com>
- Reply-To: kjhopps@mmm.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- DrLaz@aol.com wrote:
- > OK, wizards, what do you-all think is the best way to pick up after an
- > exception from the point at which it was thrown? For example--
-
- > try{
- > // code that does a lot of 'new', much of it in MSVC library code
- > // (so I can't check every new myself)
- > }
- > catch(CMemoryException* e){
- > // delete some purgeable stuff that can be re-fetched later
- > // oops, now what!
- > }
- > I could even try a 'goto' to the try block, since I in this case the
- > variables are initialized before the try, but I' sure someone has
- > thought about this deeply.
-
- Exceptions are not designed to make this easy or possible. It was a
- very conscious decision to use a termination model rather than a
- resumption model.
-
- If retrying is desired, the normal method is to put the try block inside
- a loop.
- --
- Kevin J. Hopps, 3M Company kjhopps@mmm.com
- Opinions are my own. I don't speak for 3M.
- But 3M speaks for me -- I did not write the following line:
-
- Opinions expressed herein are my own and may not represent those of 3M.
-